import { ItemModel } from "./itemModel"

export class MarketItemModel {
    item: ItemModel
    itemId: any
    amount: number
    discount: number
    monthDiscount: number
    needDiamond: number
    needGold: number
    constructor(opts: any = {}) {
        this.itemId = opts.itemId || 0
        this.item = opts.item || null
        this.amount = opts.amount || 0
        this.discount = opts.discount || 100
        this.monthDiscount = opts.monthDiscount || 100
        this.needDiamond = opts.needDiamond || 0
        this.needGold = opts.needGold || 0
    }
}


export class MarketModel {
    freeTimes: number
    refreshTimes: number
    items: MarketItemModel[]
    exp: number
    lvl: number
    buyTotalAmount: number//购买总次数
    buyDayAmount: number//今日购买次数
    totalAmount: number//刷新总次数
    worshipNotice: boolean//祭祀点提醒
    constructor(opts: any = {}) {
        this.freeTimes = opts.freeTimes || 0
        this.refreshTimes = opts.refreshTimes || 0
        this.items = opts.items || []
        this.exp = opts.exp || 0
        this.lvl = opts.lvl || 1
        this.buyTotalAmount = opts.buyTotalAmount || 0
        this.buyDayAmount = opts.buyDayAmount || 0
        this.totalAmount = opts.totalAmount || 0
        this.worshipNotice = opts.worshipNotice || false
    }
}